/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package APP1.GUI2;

import APP1.bookShop.book.Book;
import APP1.bookShop.main.BookShop;
import APP1.bookShop.order.Order;
import APP1.bookShop.order.OrderBody;
import APP1.bookShop.people.Author;
import APP1.bookShop.people.Publisher;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.DefaultListModel;
import javax.swing.JCheckBox;
import javax.swing.JComboBox;
import javax.swing.JLabel;
import javax.swing.JList;
import javax.swing.JMenu;
import javax.swing.JMenuBar;
import javax.swing.JMenuItem;
import javax.swing.JOptionPane;
import javax.swing.JRadioButton;
import javax.swing.JTextField;
import javax.swing.RowFilter;
import javax.swing.RowSorter;
import javax.swing.event.ListSelectionEvent;
import javax.swing.event.ListSelectionListener;
import javax.swing.table.DefaultTableModel;
import javax.swing.table.TableModel;
import javax.swing.table.TableRowSorter;
import org.jdesktop.swingx.JXDatePicker;

/**
 *
 * @author Asus
 */
public class MainFrame_2 extends javax.swing.JFrame {

    BookShop bookShop;
    boolean browseBookMode = false;//start with browseBookMode
    boolean browsePublisherMode = false;
    boolean OrderBrowseBookMode = false;

    public MainFrame_2(BookShop b) {
        this.bookShop = b;
        initComponents();

    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jScrollPane2 = new javax.swing.JScrollPane();
        jTable2 = new javax.swing.JTable();
        buttonGroup1 = new javax.swing.ButtonGroup();
        AuthorsTabbedPane = new javax.swing.JTabbedPane();
        jPanel1 = new javax.swing.JPanel();
        jPanel2 = new javax.swing.JPanel();
        jTextField1 = new javax.swing.JTextField();
        jTextField2 = new javax.swing.JTextField();
        jLabel1 = new javax.swing.JLabel();
        jLabel2 = new javax.swing.JLabel();
        jButton1 = new javax.swing.JButton();
        jLabel3 = new javax.swing.JLabel();
        jPanel3 = new javax.swing.JPanel();
        jScrollPane3 = new javax.swing.JScrollPane();
        jTable3 = new javax.swing.JTable();
        jLabel4 = new javax.swing.JLabel();
        jLabel5 = new javax.swing.JLabel();
        jTextField3 = new javax.swing.JTextField();
        jPanel4 = new javax.swing.JPanel();
        jScrollPane1 = new javax.swing.JScrollPane();
        jList1 = new javax.swing.JList();
        jPanel6 = new javax.swing.JPanel();
        BookTitleTypePanel = new javax.swing.JPanel();
        BookTypeLabel = new javax.swing.JLabel();
        jScrollPane4 = new javax.swing.JScrollPane();
        BookAuthorsList = new javax.swing.JList();
        jLabel8 = new javax.swing.JLabel();
        jLabel9 = new javax.swing.JLabel();
        ISBNTextField = new javax.swing.JTextField();
        jSeparator4 = new javax.swing.JSeparator();
        BookTitleTextField = new javax.swing.JTextField();
        AddNewAutorBookButton = new javax.swing.JButton();
        jButton3 = new javax.swing.JButton();
        jLabel11 = new javax.swing.JLabel();
        EbookRadioButton1 = new javax.swing.JRadioButton();
        PaperRadioButton2 = new javax.swing.JRadioButton();
        PublisherLabel = new javax.swing.JLabel();
        PublishingDateDatePicker = new org.jdesktop.swingx.JXDatePicker();
        DeleteButton = new javax.swing.JButton();
        BookPublisherComboBox = new javax.swing.JComboBox();
        jLabel25 = new javax.swing.JLabel();
        jPanel7 = new javax.swing.JPanel();
        jScrollPane5 = new javax.swing.JScrollPane();
        BookList = new javax.swing.JList();
        jLabel10 = new javax.swing.JLabel();
        jTextField4 = new javax.swing.JTextField();
        jPanel5 = new javax.swing.JPanel();
        jPanel8 = new javax.swing.JPanel();
        jLabel6 = new javax.swing.JLabel();
        jLabel12 = new javax.swing.JLabel();
        jLabel13 = new javax.swing.JLabel();
        jLabel14 = new javax.swing.JLabel();
        publisherNameTextField = new javax.swing.JTextField();
        PublisherEmailTextField = new javax.swing.JTextField();
        PublisherPOstalCodeTextField = new javax.swing.JTextField();
        PublisherPhoneNumberTextField = new javax.swing.JTextField();
        jLabel16 = new javax.swing.JLabel();
        DeletePublisherButton = new javax.swing.JButton();
        AddPublisherButton = new javax.swing.JButton();
        jScrollPane6 = new javax.swing.JScrollPane();
        PublishersList = new javax.swing.JList();
        jScrollPane7 = new javax.swing.JScrollPane();
        PublisherBooksList = new javax.swing.JList();
        jLabel17 = new javax.swing.JLabel();
        jLabel18 = new javax.swing.JLabel();
        jPanel9 = new javax.swing.JPanel();
        jPanel10 = new javax.swing.JPanel();
        jLabel15 = new javax.swing.JLabel();
        jLabel19 = new javax.swing.JLabel();
        DeliveryDatePicker = new org.jdesktop.swingx.JXDatePicker();
        OrderDatePicker = new org.jdesktop.swingx.JXDatePicker();
        jLabel20 = new javax.swing.JLabel();
        PriceTextField = new javax.swing.JTextField();
        jScrollPane8 = new javax.swing.JScrollPane();
        OrderContentList = new javax.swing.JList();
        jLabel22 = new javax.swing.JLabel();
        DeleteOrder = new javax.swing.JButton();
        AddNewOrderButton = new javax.swing.JButton();
        ProcessButton = new javax.swing.JButton();
        OrderPublisherComboBox1 = new javax.swing.JComboBox();
        jLabel23 = new javax.swing.JLabel();
        jLabel24 = new javax.swing.JLabel();
        jScrollPane10 = new javax.swing.JScrollPane();
        BookToBeOrderedList = new javax.swing.JList();
        jScrollPane9 = new javax.swing.JScrollPane();
        OrderList = new javax.swing.JList();
        jLabel21 = new javax.swing.JLabel();
        PendingOrdersCheckBox = new javax.swing.JCheckBox();
        jMenuBar1 = new javax.swing.JMenuBar();
        FileMenu = new javax.swing.JMenu();
        ExitMenuItem = new javax.swing.JMenuItem();
        jMenu2 = new javax.swing.JMenu();
        jCheckBoxMenuItem1 = new javax.swing.JCheckBoxMenuItem();
        jMenu1 = new javax.swing.JMenu();

        jTable2.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null}
            },
            new String [] {
                "Title 1", "Title 2", "Title 3", "Title 4"
            }
        ));
        jScrollPane2.setViewportView(jTable2);

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setTitle("JBookShop Plymouth");
        setResizable(false);

        jPanel2.setBackground(new java.awt.Color(230, 230, 230));
        jPanel2.setBorder(javax.swing.BorderFactory.createEtchedBorder());

        jLabel1.setText("First Name");

        jLabel2.setText("Last Name");

        jButton1.setText("Add Author");
        jButton1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton1ActionPerformed(evt);
            }
        });

        jLabel3.setText("Add a new Author");

        javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
        jPanel2.setLayout(jPanel2Layout);
        jPanel2Layout.setHorizontalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addComponent(jLabel1)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jTextField2, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(11, 11, 11)
                .addComponent(jLabel2)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, 101, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(36, 36, 36)
                .addComponent(jButton1)
                .addGap(22, 22, 22))
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jLabel3)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        jPanel2Layout.setVerticalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jLabel3)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 22, Short.MAX_VALUE)
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel2)
                    .addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jTextField2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel1)
                    .addComponent(jButton1, javax.swing.GroupLayout.PREFERRED_SIZE, 33, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap())
        );

        jPanel3.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0), 2));

        jTable3.setModel(bookShop.getAuthorController().getTableMOdelAuthorList());
        jTable3.setRowSorter(createjTable2TableSorter());
        jTable3.setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION);
        jTable3.getTableHeader().setResizingAllowed(false);
        jTable3.getTableHeader().setReorderingAllowed(false);
        jTable3.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jTable3MouseClicked(evt);
            }
        });
        jScrollPane3.setViewportView(jTable3);

        jLabel4.setText("Double click for the author's book list");

        jLabel5.setText("Filter");

        jTextField3.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jTextField3ActionPerformed(evt);
            }
        });
        jTextField3.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyTyped(java.awt.event.KeyEvent evt) {
                jTextField3KeyTyped(evt);
            }
        });

        javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3);
        jPanel3.setLayout(jPanel3Layout);
        jPanel3Layout.setHorizontalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jScrollPane3)
            .addGroup(jPanel3Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jLabel4)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addComponent(jLabel5)
                .addGap(18, 18, 18)
                .addComponent(jTextField3, javax.swing.GroupLayout.PREFERRED_SIZE, 149, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap())
        );
        jPanel3Layout.setVerticalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel3Layout.createSequentialGroup()
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel4)
                    .addComponent(jLabel5)
                    .addComponent(jTextField3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jScrollPane3, javax.swing.GroupLayout.PREFERRED_SIZE, 201, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap())
        );

        jPanel4.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0), 2));

        jList1.setModel(new javax.swing.AbstractListModel() {
            String[] strings = { "No Books" };
            public int getSize() { return strings.length; }
            public Object getElementAt(int i) { return strings[i]; }
        });
        jScrollPane1.setViewportView(jList1);

        javax.swing.GroupLayout jPanel4Layout = new javax.swing.GroupLayout(jPanel4);
        jPanel4.setLayout(jPanel4Layout);
        jPanel4Layout.setHorizontalGroup(
            jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jScrollPane1)
        );
        jPanel4Layout.setVerticalGroup(
            jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel4Layout.createSequentialGroup()
                .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(0, 3, Short.MAX_VALUE))
        );

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addGap(0, 725, Short.MAX_VALUE)
                .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
            .addComponent(jPanel3, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
            .addComponent(jPanel4, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jPanel3, javax.swing.GroupLayout.PREFERRED_SIZE, 253, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jPanel4, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        AuthorsTabbedPane.addTab("Authors", jPanel1);

        BookTitleTypePanel.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0), 2));

        BookTypeLabel.setFont(new java.awt.Font("Tahoma", 2, 13)); // NOI18N
        BookTypeLabel.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);

        jScrollPane4.setViewportView(BookAuthorsList);

        jLabel8.setText("ISBN");

        jLabel9.setText("Publishing Date ");

        ISBNTextField.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                ISBNTextFieldActionPerformed(evt);
            }
        });

        jSeparator4.setOrientation(javax.swing.SwingConstants.VERTICAL);

        BookTitleTextField.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N
        BookTitleTextField.setHorizontalAlignment(javax.swing.JTextField.CENTER);
        BookTitleTextField.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                BookTitleTextFieldActionPerformed(evt);
            }
        });

        AddNewAutorBookButton.setText("Add an author");
        AddNewAutorBookButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                AddNewAutorBookButtonActionPerformed(evt);
            }
        });

        jButton3.setText("Add Book");
        jButton3.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jButton3MouseClicked(evt);
            }
        });
        jButton3.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton3ActionPerformed(evt);
            }
        });

        jLabel11.setFont(new java.awt.Font("Tahoma", 2, 14)); // NOI18N
        jLabel11.setText("Book Title");

        buttonGroup1.add(EbookRadioButton1);
        EbookRadioButton1.setText("Ebook");

        buttonGroup1.add(PaperRadioButton2);
        PaperRadioButton2.setSelected(true);
        PaperRadioButton2.setText("Paper");

        DeleteButton.setText("Delete Book");
        DeleteButton.setEnabled(false);
        DeleteButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                DeleteButtonActionPerformed(evt);
            }
        });

        BookPublisherComboBox.setModel(bookShop.getPublisherController().getPublishersComboBoxModel());
        BookPublisherComboBox.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                BookPublisherComboBoxActionPerformed(evt);
            }
        });

        jLabel25.setText("Publisher");

        javax.swing.GroupLayout BookTitleTypePanelLayout = new javax.swing.GroupLayout(BookTitleTypePanel);
        BookTitleTypePanel.setLayout(BookTitleTypePanelLayout);
        BookTitleTypePanelLayout.setHorizontalGroup(
            BookTitleTypePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(BookTitleTypePanelLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(BookTitleTypePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(BookTitleTypePanelLayout.createSequentialGroup()
                        .addComponent(jLabel11, javax.swing.GroupLayout.PREFERRED_SIZE, 108, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                    .addGroup(BookTitleTypePanelLayout.createSequentialGroup()
                        .addGroup(BookTitleTypePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(BookTitleTextField)
                            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, BookTitleTypePanelLayout.createSequentialGroup()
                                .addGroup(BookTitleTypePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addGroup(BookTitleTypePanelLayout.createSequentialGroup()
                                        .addComponent(jLabel9)
                                        .addGap(9, 9, 9)
                                        .addComponent(PublishingDateDatePicker, javax.swing.GroupLayout.PREFERRED_SIZE, 166, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                        .addComponent(BookTypeLabel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                        .addGap(35, 35, 35)
                                        .addComponent(jLabel8)
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                        .addComponent(ISBNTextField, javax.swing.GroupLayout.PREFERRED_SIZE, 163, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addGap(43, 43, 43)
                                        .addGroup(BookTitleTypePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                            .addGroup(BookTitleTypePanelLayout.createSequentialGroup()
                                                .addGap(35, 35, 35)
                                                .addComponent(jLabel25, javax.swing.GroupLayout.PREFERRED_SIZE, 83, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                .addComponent(BookPublisherComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, 165, javax.swing.GroupLayout.PREFERRED_SIZE))
                                            .addComponent(PublisherLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 201, javax.swing.GroupLayout.PREFERRED_SIZE))
                                        .addGap(20, 20, 20))
                                    .addGroup(BookTitleTypePanelLayout.createSequentialGroup()
                                        .addGap(140, 140, 140)
                                        .addComponent(jButton3)
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                        .addComponent(DeleteButton)
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))
                                .addGroup(BookTitleTypePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(PaperRadioButton2, javax.swing.GroupLayout.PREFERRED_SIZE, 72, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(EbookRadioButton1, javax.swing.GroupLayout.PREFERRED_SIZE, 82, javax.swing.GroupLayout.PREFERRED_SIZE))
                                .addGap(39, 39, 39)))
                        .addGap(14, 14, 14)))
                .addComponent(jSeparator4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(BookTitleTypePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addComponent(jScrollPane4, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE)
                    .addComponent(AddNewAutorBookButton, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 206, Short.MAX_VALUE))
                .addContainerGap())
        );
        BookTitleTypePanelLayout.setVerticalGroup(
            BookTitleTypePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jSeparator4)
            .addGroup(BookTitleTypePanelLayout.createSequentialGroup()
                .addGroup(BookTitleTypePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(BookTitleTypePanelLayout.createSequentialGroup()
                        .addGap(36, 36, 36)
                        .addComponent(jScrollPane4, javax.swing.GroupLayout.PREFERRED_SIZE, 95, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(BookTitleTypePanelLayout.createSequentialGroup()
                        .addGap(3, 3, 3)
                        .addComponent(jLabel11)
                        .addGap(2, 2, 2)
                        .addComponent(BookTitleTextField, javax.swing.GroupLayout.PREFERRED_SIZE, 69, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGroup(BookTitleTypePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(BookTitleTypePanelLayout.createSequentialGroup()
                                .addGap(5, 5, 5)
                                .addComponent(BookTypeLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 17, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addGroup(BookTitleTypePanelLayout.createSequentialGroup()
                                .addGap(18, 18, 18)
                                .addGroup(BookTitleTypePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                    .addComponent(jLabel9)
                                    .addComponent(jLabel8)
                                    .addComponent(ISBNTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(PublisherLabel)
                                    .addComponent(EbookRadioButton1, javax.swing.GroupLayout.PREFERRED_SIZE, 22, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(PublishingDateDatePicker, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(BookPublisherComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(jLabel25))))))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(BookTitleTypePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(BookTitleTypePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(jButton3)
                        .addComponent(DeleteButton))
                    .addComponent(AddNewAutorBookButton)
                    .addComponent(PaperRadioButton2))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        jPanel7.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0), 2));

        BookList.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
        BookList.setModel(bookShop.getBokController().getBookTitleListModel());
        BookList.setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION);
        BookList.addListSelectionListener(new ListSelectionListener()
            {
                public void valueChanged(ListSelectionEvent ev)
                {
                    if(browseBookMode){//handle deselection list
                        int selected=BookList.getSelectedIndex();
                        if(selected>=0){
                            bookShop.getBokController().handleDetailBook(selected);
                            BookAuthorsList.setModel(bookShop.getBokController().getAuthorsofBookListModel(bookShop.getBooks().get(BookList.getSelectedIndex())));

                            AddNewAutorBookButton.setEnabled(true);
                            DeleteButton.setEnabled(true);
                            jButton3.setText("New Book Mode");
                        }
                    }else{
                        browseBookMode=true;

                    }

                }
            });
            jScrollPane5.setViewportView(BookList);

            jLabel10.setText("Filter");

            javax.swing.GroupLayout jPanel7Layout = new javax.swing.GroupLayout(jPanel7);
            jPanel7.setLayout(jPanel7Layout);
            jPanel7Layout.setHorizontalGroup(
                jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addComponent(jScrollPane5)
                .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel7Layout.createSequentialGroup()
                    .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jLabel10)
                    .addGap(18, 18, 18)
                    .addComponent(jTextField4, javax.swing.GroupLayout.PREFERRED_SIZE, 188, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addContainerGap())
            );
            jPanel7Layout.setVerticalGroup(
                jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel7Layout.createSequentialGroup()
                    .addContainerGap()
                    .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(jLabel10)
                        .addComponent(jTextField4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addComponent(jScrollPane5, javax.swing.GroupLayout.DEFAULT_SIZE, 288, Short.MAX_VALUE))
            );

            javax.swing.GroupLayout jPanel6Layout = new javax.swing.GroupLayout(jPanel6);
            jPanel6.setLayout(jPanel6Layout);
            jPanel6Layout.setHorizontalGroup(
                jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel6Layout.createSequentialGroup()
                    .addContainerGap()
                    .addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                        .addComponent(jPanel7, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addComponent(BookTitleTypePanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                    .addContainerGap())
            );
            jPanel6Layout.setVerticalGroup(
                jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(jPanel6Layout.createSequentialGroup()
                    .addComponent(BookTitleTypePanel, javax.swing.GroupLayout.PREFERRED_SIZE, 180, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addComponent(jPanel7, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
            );

            AuthorsTabbedPane.addTab("Books", jPanel6);

            jPanel8.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0), 2));

            jLabel6.setText("name");

            jLabel12.setText("email");

            jLabel13.setText("postal-code");

            jLabel14.setText("phone-number");

            jLabel16.setText("Publisher infos");

            DeletePublisherButton.setText("Delete");
            DeletePublisherButton.setEnabled(false);
            DeletePublisherButton.addActionListener(new java.awt.event.ActionListener() {
                public void actionPerformed(java.awt.event.ActionEvent evt) {
                    DeletePublisherButtonActionPerformed(evt);
                }
            });

            AddPublisherButton.setText("Add new publisher");
            AddPublisherButton.addActionListener(new java.awt.event.ActionListener() {
                public void actionPerformed(java.awt.event.ActionEvent evt) {
                    AddPublisherButtonActionPerformed(evt);
                }
            });

            javax.swing.GroupLayout jPanel8Layout = new javax.swing.GroupLayout(jPanel8);
            jPanel8.setLayout(jPanel8Layout);
            jPanel8Layout.setHorizontalGroup(
                jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(jPanel8Layout.createSequentialGroup()
                    .addContainerGap()
                    .addGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                        .addGroup(jPanel8Layout.createSequentialGroup()
                            .addGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                .addComponent(jLabel6)
                                .addComponent(jLabel12)
                                .addComponent(jLabel13))
                            .addGap(30, 30, 30)
                            .addGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                .addComponent(PublisherEmailTextField, javax.swing.GroupLayout.PREFERRED_SIZE, 191, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addComponent(PublisherPOstalCodeTextField, javax.swing.GroupLayout.PREFERRED_SIZE, 191, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addComponent(publisherNameTextField, javax.swing.GroupLayout.PREFERRED_SIZE, 191, javax.swing.GroupLayout.PREFERRED_SIZE)))
                        .addGroup(jPanel8Layout.createSequentialGroup()
                            .addComponent(jLabel14)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                            .addComponent(PublisherPhoneNumberTextField, javax.swing.GroupLayout.PREFERRED_SIZE, 191, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addComponent(jLabel16, javax.swing.GroupLayout.PREFERRED_SIZE, 92, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGroup(jPanel8Layout.createSequentialGroup()
                            .addComponent(DeletePublisherButton)
                            .addGap(18, 18, 18)
                            .addComponent(AddPublisherButton)))
                    .addContainerGap(42, Short.MAX_VALUE))
            );
            jPanel8Layout.setVerticalGroup(
                jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(jPanel8Layout.createSequentialGroup()
                    .addComponent(jLabel16)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(jLabel6)
                        .addComponent(publisherNameTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGap(18, 18, 18)
                    .addGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(jLabel12)
                        .addComponent(PublisherEmailTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGap(18, 18, 18)
                    .addGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(jLabel13)
                        .addComponent(PublisherPOstalCodeTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGap(18, 18, 18)
                    .addGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(jLabel14)
                        .addComponent(PublisherPhoneNumberTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGap(18, 18, 18)
                    .addGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(DeletePublisherButton)
                        .addComponent(AddPublisherButton))
                    .addContainerGap(29, Short.MAX_VALUE))
            );

            PublishersList.setModel(bookShop.getPublisherController().getPublishersListModel());
            PublishersList.addListSelectionListener(new ListSelectionListener()
                {
                    public void valueChanged(ListSelectionEvent ev)
                    {
                        if(browsePublisherMode){//handle deselection list
                            int selected=PublishersList.getSelectedIndex();
                            if(selected>=0){
                                bookShop.getPublisherController().handleDetailPublisher(selected);
                                PublisherBooksList.setModel(bookShop.getPublisherController().getboksOfPublisherListModel(bookShop.getPublishers().get(PublishersList.getSelectedIndex())));
                                AddPublisherButton.setEnabled(true);
                                AddPublisherButton.setText("Add Publisher Mode");
                                DeletePublisherButton.setEnabled(true);

                            }
                        }else{
                            browsePublisherMode=true;

                        }

                    }
                });
                jScrollPane6.setViewportView(PublishersList);

                PublisherBooksList.setModel(new javax.swing.AbstractListModel() {
                    String[] strings = { "Select a publisher" };
                    public int getSize() { return strings.length; }
                    public Object getElementAt(int i) { return strings[i]; }
                });
                jScrollPane7.setViewportView(PublisherBooksList);

                jLabel17.setText("Published Books");

                jLabel18.setText("Publishers list");

                javax.swing.GroupLayout jPanel5Layout = new javax.swing.GroupLayout(jPanel5);
                jPanel5.setLayout(jPanel5Layout);
                jPanel5Layout.setHorizontalGroup(
                    jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel5Layout.createSequentialGroup()
                        .addComponent(jPanel8, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jScrollPane7, javax.swing.GroupLayout.DEFAULT_SIZE, 902, Short.MAX_VALUE)
                            .addGroup(jPanel5Layout.createSequentialGroup()
                                .addComponent(jLabel17)
                                .addGap(0, 0, Short.MAX_VALUE))))
                    .addComponent(jScrollPane6)
                    .addGroup(jPanel5Layout.createSequentialGroup()
                        .addContainerGap()
                        .addComponent(jLabel18)
                        .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                );
                jPanel5Layout.setVerticalGroup(
                    jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel5Layout.createSequentialGroup()
                        .addContainerGap()
                        .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addGroup(jPanel5Layout.createSequentialGroup()
                                .addComponent(jLabel17)
                                .addGap(18, 18, 18)
                                .addComponent(jScrollPane7, javax.swing.GroupLayout.PREFERRED_SIZE, 218, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addComponent(jPanel8, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addGap(26, 26, 26)
                        .addComponent(jLabel18)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addComponent(jScrollPane6, javax.swing.GroupLayout.PREFERRED_SIZE, 228, javax.swing.GroupLayout.PREFERRED_SIZE))
                );

                AuthorsTabbedPane.addTab("Publisher", jPanel5);

                jPanel10.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0), 2));

                jLabel15.setText("Order Date");

                jLabel19.setText("Delivery Date");

                jLabel20.setText("Price");

                jScrollPane8.setViewportView(OrderContentList);

                jLabel22.setText("Order Content");

                DeleteOrder.setText("Delete Order");
                DeleteOrder.addActionListener(new java.awt.event.ActionListener() {
                    public void actionPerformed(java.awt.event.ActionEvent evt) {
                        DeleteOrderActionPerformed(evt);
                    }
                });

                AddNewOrderButton.setText("Add  New Order");
                AddNewOrderButton.addActionListener(new java.awt.event.ActionListener() {
                    public void actionPerformed(java.awt.event.ActionEvent evt) {
                        AddNewOrderButtonActionPerformed(evt);
                    }
                });

                ProcessButton.setText("Process ");
                ProcessButton.setEnabled(false);
                ProcessButton.addActionListener(new java.awt.event.ActionListener() {
                    public void actionPerformed(java.awt.event.ActionEvent evt) {
                        ProcessButtonActionPerformed(evt);
                    }
                });

                OrderPublisherComboBox1.setModel(bookShop.getPublisherController().getPublishersComboBoxModel());
                OrderPublisherComboBox1.addActionListener(new ActionListener () {
                    public void actionPerformed(ActionEvent e) {
                        BookToBeOrderedList.setModel(bookShop.getOrdersController().getBooksToBeOrdered(bookShop.getPublishers().get(OrderPublisherComboBox1.getSelectedIndex()), OrderContentList.getModel()));
                    }
                });
                OrderPublisherComboBox1.addActionListener(new java.awt.event.ActionListener() {
                    public void actionPerformed(java.awt.event.ActionEvent evt) {
                        OrderPublisherComboBox1ActionPerformed(evt);
                    }
                });

                jLabel23.setText("Publisher");

                jLabel24.setText("Books may be ordered (double click to add)");

                BookToBeOrderedList.addMouseListener(new java.awt.event.MouseAdapter() {
                    public void mouseClicked(java.awt.event.MouseEvent evt) {
                        BookToBeOrderedListMouseClicked(evt);
                    }
                });
                jScrollPane10.setViewportView(BookToBeOrderedList);

                javax.swing.GroupLayout jPanel10Layout = new javax.swing.GroupLayout(jPanel10);
                jPanel10.setLayout(jPanel10Layout);
                jPanel10Layout.setHorizontalGroup(
                    jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel10Layout.createSequentialGroup()
                        .addGroup(jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(AddNewOrderButton, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addGroup(jPanel10Layout.createSequentialGroup()
                                .addGap(20, 20, 20)
                                .addGroup(jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                                    .addGroup(jPanel10Layout.createSequentialGroup()
                                        .addComponent(jLabel19, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                        .addComponent(DeliveryDatePicker, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                                    .addGroup(jPanel10Layout.createSequentialGroup()
                                        .addComponent(jLabel15, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                        .addComponent(OrderDatePicker, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                                    .addGroup(jPanel10Layout.createSequentialGroup()
                                        .addGroup(jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                                            .addComponent(jLabel20, javax.swing.GroupLayout.DEFAULT_SIZE, 75, Short.MAX_VALUE)
                                            .addComponent(jLabel23, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                        .addGroup(jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                            .addComponent(OrderPublisherComboBox1, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                            .addComponent(PriceTextField))))
                                .addGap(0, 35, Short.MAX_VALUE))
                            .addGroup(jPanel10Layout.createSequentialGroup()
                                .addComponent(DeleteOrder, javax.swing.GroupLayout.PREFERRED_SIZE, 125, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(ProcessButton, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))
                        .addGroup(jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(jPanel10Layout.createSequentialGroup()
                                .addGap(18, 18, 18)
                                .addComponent(jLabel22)
                                .addGap(289, 289, 289))
                            .addGroup(jPanel10Layout.createSequentialGroup()
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                .addComponent(jScrollPane8, javax.swing.GroupLayout.PREFERRED_SIZE, 341, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addGap(32, 32, 32)))
                        .addGroup(jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jScrollPane10, javax.swing.GroupLayout.PREFERRED_SIZE, 602, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel24, javax.swing.GroupLayout.PREFERRED_SIZE, 260, javax.swing.GroupLayout.PREFERRED_SIZE)))
                );
                jPanel10Layout.setVerticalGroup(
                    jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel10Layout.createSequentialGroup()
                        .addContainerGap()
                        .addGroup(jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabel15)
                            .addComponent(OrderDatePicker, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel19)
                            .addComponent(DeliveryDatePicker, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addGroup(jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel20)
                            .addComponent(PriceTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addGroup(jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(OrderPublisherComboBox1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addGroup(jPanel10Layout.createSequentialGroup()
                                .addGap(3, 3, 3)
                                .addComponent(jLabel23, javax.swing.GroupLayout.PREFERRED_SIZE, 14, javax.swing.GroupLayout.PREFERRED_SIZE)))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 8, Short.MAX_VALUE)
                        .addGroup(jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(DeleteOrder)
                            .addComponent(ProcessButton))
                        .addGap(18, 18, 18)
                        .addComponent(AddNewOrderButton)
                        .addContainerGap())
                    .addGroup(jPanel10Layout.createSequentialGroup()
                        .addGap(11, 11, 11)
                        .addGroup(jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(jPanel10Layout.createSequentialGroup()
                                .addComponent(jLabel22)
                                .addGap(0, 0, Short.MAX_VALUE))
                            .addComponent(jLabel24, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                            .addComponent(jScrollPane8)
                            .addComponent(jScrollPane10, javax.swing.GroupLayout.DEFAULT_SIZE, 193, Short.MAX_VALUE)))
                );

                OrderList.setModel(bookShop.getOrdersController().getOrdersListModel(!PendingOrdersCheckBox.isSelected()));
                OrderList.addListSelectionListener(new ListSelectionListener()
                    {
                        public void valueChanged(ListSelectionEvent ev)
                        {

                            if(OrderBrowseBookMode){//handle deselection list

                                int selected=OrderList.getSelectedIndex();
                                if(selected>=0){
                                    bookShop.getOrdersController().handleDetailOrder(selected);
                                    OrderContentList.setModel(bookShop.getOrdersController().getOrderContentListModel(bookShop.getOrders().get(OrderList.getSelectedIndex())));
                                    AddNewOrderButton.setEnabled(true);
                                    DeleteOrder.setEnabled(true);
                                    AddNewOrderButton.setText("New Order Mode");

                                    OrderDatePicker.setEnabled(false);
                                    DeliveryDatePicker.setEnabled(false);
                                    PriceTextField.setEnabled(false);
                                    OrderPublisherComboBox1.setEnabled(false);
                                    BookToBeOrderedList.setEnabled(false);
                                }
                            }else{
                                OrderBrowseBookMode=true;

                            }

                        }
                    });
                    jScrollPane9.setViewportView(OrderList);

                    jLabel21.setText("Orders List");

                    PendingOrdersCheckBox.setText("Pending only");
                    PendingOrdersCheckBox.addChangeListener(new javax.swing.event.ChangeListener() {
                        public void stateChanged(javax.swing.event.ChangeEvent evt) {
                            PendingOrdersCheckBoxStateChanged(evt);
                        }
                    });
                    PendingOrdersCheckBox.addActionListener(new java.awt.event.ActionListener() {
                        public void actionPerformed(java.awt.event.ActionEvent evt) {
                            PendingOrdersCheckBoxActionPerformed(evt);
                        }
                    });

                    javax.swing.GroupLayout jPanel9Layout = new javax.swing.GroupLayout(jPanel9);
                    jPanel9.setLayout(jPanel9Layout);
                    jPanel9Layout.setHorizontalGroup(
                        jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                        .addComponent(jPanel10, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addComponent(jScrollPane9)
                        .addGroup(jPanel9Layout.createSequentialGroup()
                            .addComponent(PendingOrdersCheckBox)
                            .addGap(386, 386, 386)
                            .addComponent(jLabel21)
                            .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                    );
                    jPanel9Layout.setVerticalGroup(
                        jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                        .addGroup(jPanel9Layout.createSequentialGroup()
                            .addComponent(jPanel10, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                            .addGroup(jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                .addComponent(jLabel21)
                                .addComponent(PendingOrdersCheckBox))
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 7, Short.MAX_VALUE)
                            .addComponent(jScrollPane9, javax.swing.GroupLayout.PREFERRED_SIZE, 257, javax.swing.GroupLayout.PREFERRED_SIZE))
                    );

                    AuthorsTabbedPane.addTab("Order", jPanel9);

                    jMenuBar1.setToolTipText("");

                    FileMenu.setText("File");

                    ExitMenuItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_F4, java.awt.event.InputEvent.ALT_MASK));
                    ExitMenuItem.setText("Exit");
                    ExitMenuItem.addActionListener(new java.awt.event.ActionListener() {
                        public void actionPerformed(java.awt.event.ActionEvent evt) {
                            ExitMenuItemActionPerformed(evt);
                        }
                    });
                    FileMenu.add(ExitMenuItem);

                    jMenuBar1.add(FileMenu);

                    jMenu2.setText("Authors");

                    jCheckBoxMenuItem1.setSelected(true);
                    jCheckBoxMenuItem1.setText("Visible");
                    jCheckBoxMenuItem1.addActionListener(new java.awt.event.ActionListener() {
                        public void actionPerformed(java.awt.event.ActionEvent evt) {
                            jCheckBoxMenuItem1ActionPerformed(evt);
                        }
                    });
                    jMenu2.add(jCheckBoxMenuItem1);

                    jMenuBar1.add(jMenu2);

                    jMenu1.setText("Books");
                    jMenuBar1.add(jMenu1);

                    setJMenuBar(jMenuBar1);

                    javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
                    getContentPane().setLayout(layout);
                    layout.setHorizontalGroup(
                        layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                        .addComponent(AuthorsTabbedPane)
                    );
                    layout.setVerticalGroup(
                        layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                        .addComponent(AuthorsTabbedPane, javax.swing.GroupLayout.PREFERRED_SIZE, 551, javax.swing.GroupLayout.PREFERRED_SIZE)
                    );

                    pack();
                }// </editor-fold>//GEN-END:initComponents

    private void ExitMenuItemActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_ExitMenuItemActionPerformed
        System.exit(0);
    }//GEN-LAST:event_ExitMenuItemActionPerformed

    private void jCheckBoxMenuItem1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jCheckBoxMenuItem1ActionPerformed

    }//GEN-LAST:event_jCheckBoxMenuItem1ActionPerformed

    private void AddPublisherButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_AddPublisherButtonActionPerformed
        if (browsePublisherMode) {
            //go to addBook MOde -> delete all inputField change button name in addBook
            browsePublisherMode = false;
            AddPublisherButton.setText("Add new Publisher");

            publisherNameTextField.setText("");
            PublisherPOstalCodeTextField.setText("");
            PublisherEmailTextField.setText("");
            PublisherPhoneNumberTextField.setText("");

            ((DefaultListModel) PublisherBooksList.getModel()).removeAllElements();
            PublishersList.clearSelection();

        } else {
            //already in addBookMode -> just launch the addProcedure
            checkForMessagges(bookShop.getPublisherController().addPublisher(publisherNameTextField.getText(), PublisherPOstalCodeTextField.getText(), PublisherEmailTextField.getText(), PublisherPhoneNumberTextField.getText()));

        }
    }//GEN-LAST:event_AddPublisherButtonActionPerformed

    private void DeleteButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_DeleteButtonActionPerformed
        Book booktoRemove = bookShop.getBooks().get(BookList.getSelectedIndex());
        booktoRemove.getPublisher().getBook().remove(booktoRemove);
        for (Author author : booktoRemove.getAuthors()) {
            author.getBookList().remove(booktoRemove);
        }
        bookShop.getBokController().deleteBook(bookShop.getBooks().get(BookList.getSelectedIndex()));
        BookList.setSelectedIndex(0);
        bookShop.getGUI().getBookList().setModel(bookShop.getBokController().getBookTitleListModel());
        addBookMode();
    }//GEN-LAST:event_DeleteButtonActionPerformed

    private void jButton3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton3ActionPerformed
        if (browseBookMode) {
            //go to addBook MOde -> delete all inputField change button name in addBook
            browseBookMode = false;
            jButton3.setText("Add new Book");
            
            BookTitleTextField.setText("");
            PublishingDateDatePicker.setDate(null);
            ISBNTextField.setText("");
            PublisherLabel.setText("");
            ((DefaultListModel) BookAuthorsList.getModel()).removeAllElements();
            BookList.clearSelection();

        } else {
            //already in addBookMode -> just launch the addProcedure
            Boolean selectedType = null;
            if (EbookRadioButton1.isSelected()) {
                selectedType = false;
            } else if (PaperRadioButton2.isSelected()) {
                selectedType = true;
            }

            checkForMessagges(
            bookShop.getBokController().
                    addBook(BookTitleTextField.getText(), PublishingDateDatePicker.getDate(), ISBNTextField.getText(), selectedType,(Publisher)BookPublisherComboBox.getSelectedItem(),BookAuthorsList.getModel())
            );

        }
    }//GEN-LAST:event_jButton3ActionPerformed

    private void jButton3MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jButton3MouseClicked

    }//GEN-LAST:event_jButton3MouseClicked

    public JComboBox getOrderPublisherComboBox1() {
        return OrderPublisherComboBox1;
    }

    private void AddNewAutorBookButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_AddNewAutorBookButtonActionPerformed
        int selected = BookList.getSelectedIndex();
        DefaultListModel lm;
        if (selected >= 0) {
            lm = bookShop.getAuthorController().getNONAuthorsOfaBook(bookShop.getBooks().get(selected));
        } else {
            lm = bookShop.getAuthorController().getNONAuthorsOfaBook(null);
        }
        AddAuthorBook addAuthor = new AddAuthorBook(this, true, lm, this);
        addAuthor.show();
    }//GEN-LAST:event_AddNewAutorBookButtonActionPerformed

    private void BookTitleTextFieldActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_BookTitleTextFieldActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_BookTitleTextFieldActionPerformed

    private void ISBNTextFieldActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_ISBNTextFieldActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_ISBNTextFieldActionPerformed

    private void jTextField3KeyTyped(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_jTextField3KeyTyped
        jTable3.setRowSorter(createjTable2TableSorter());
    }//GEN-LAST:event_jTextField3KeyTyped

    private void jTextField3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jTextField3ActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_jTextField3ActionPerformed

    private void jTable3MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jTable3MouseClicked
        int row = jTable3.rowAtPoint(evt.getPoint());

        if (row >= 0) {
            DefaultListModel lm = bookShop.getAuthorController().getAuthorBookTitleListListModel(bookShop.getAuthors().get(row));
            jList1.setModel(lm);
        }
    }//GEN-LAST:event_jTable3MouseClicked

    private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
        checkForMessagges(
                bookShop.getAuthorController().addNewAuthor(jTextField1.getText(), jTextField2.getText())
        );
        jTable3.setModel(bookShop.getAuthorController().getTableMOdelAuthorList());
        
    }//GEN-LAST:event_jButton1ActionPerformed

    private void PendingOrdersCheckBoxStateChanged(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_PendingOrdersCheckBoxStateChanged

    }//GEN-LAST:event_PendingOrdersCheckBoxStateChanged

    private void PendingOrdersCheckBoxActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_PendingOrdersCheckBoxActionPerformed
        System.err.println(""+PendingOrdersCheckBox.isSelected());
        OrderList.setModel(bookShop.getOrdersController().getOrdersListModel(!PendingOrdersCheckBox.isSelected()));
        ProcessButton.setEnabled(PendingOrdersCheckBox.isSelected());
    }//GEN-LAST:event_PendingOrdersCheckBoxActionPerformed

    private void AddNewOrderButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_AddNewOrderButtonActionPerformed
        if (OrderBrowseBookMode) {
            //go to addBook MOde -> delete all inputField change button name in addBook
            OrderBrowseBookMode = false;
            AddNewOrderButton.setText("Add new Order");

            OrderDatePicker.setDate(null);
            DeliveryDatePicker.setDate(null);
            PriceTextField.setText("");

            ((DefaultListModel) OrderContentList.getModel()).removeAllElements();
            OrderDatePicker.setEnabled(true);
            DeliveryDatePicker.setEnabled(true);
            PriceTextField.setEnabled(true);
            OrderPublisherComboBox1.setEnabled(true);
            BookToBeOrderedList.setEnabled(true);
            OrderPublisherComboBox1.setEnabled(true);
        } else {

            checkForMessagges(bookShop.getOrdersController().addOrder(OrderDatePicker.getDate(), DeliveryDatePicker.getDate(), PriceTextField.getText(), OrderContentList.getModel(), (Publisher) OrderPublisherComboBox1.getSelectedItem()));

        }
    }//GEN-LAST:event_AddNewOrderButtonActionPerformed

    public JCheckBox getPendingOrdersCheckBox() {
        return PendingOrdersCheckBox;
    }

    private void DeleteOrderActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_DeleteOrderActionPerformed
        bookShop.getOrdersController().deleteOrder(bookShop.getOrders().get(OrderList.getSelectedIndex()));
        OrderList.setSelectedIndex(0);
        bookShop.getGUI().getOrderList().setModel(bookShop.getOrdersController().getOrdersListModel(!PendingOrdersCheckBox.isSelected()));

    }//GEN-LAST:event_DeleteOrderActionPerformed

    private void OrderPublisherComboBox1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_OrderPublisherComboBox1ActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_OrderPublisherComboBox1ActionPerformed

    private void BookToBeOrderedListMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_BookToBeOrderedListMouseClicked
        if (BookToBeOrderedList.isEnabled()) {
            if (evt.getClickCount() == 2) {
                
                AddOrderBody orderBodyAdd = new AddOrderBody(this, true, this, (Book) BookToBeOrderedList.getSelectedValue());
                orderBodyAdd.show();
                OrderPublisherComboBox1.setEnabled(false);
            }
        }
    }//GEN-LAST:event_BookToBeOrderedListMouseClicked

    private void ProcessButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_ProcessButtonActionPerformed
       Order toBeProcessed = (Order)OrderList.getSelectedValue();
        for (OrderBody ob : toBeProcessed.getOrderBody()) {
            bookShop.getBookStocks().get(ob.getBook()).AddCopies(ob.getCopies());
            System.err.println(ob.getCopies()+" al book"+ob.getBook() );
        }
        BookList.setModel(bookShop.getBokController().getBookTitleListModel());
        checkForMessagges("Processed. Stock updated");
    }//GEN-LAST:event_ProcessButtonActionPerformed

    private void BookPublisherComboBoxActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_BookPublisherComboBoxActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_BookPublisherComboBoxActionPerformed

    private void DeletePublisherButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_DeletePublisherButtonActionPerformed

    }//GEN-LAST:event_DeletePublisherButtonActionPerformed

    public JList getOrderContentList() {
        return OrderContentList;
    }

    private void addBookMode() {
        browseBookMode = false;
        jButton3.setText("Add new Book");
        
        BookTitleTextField.setText("");
        PublishingDateDatePicker.setDate(null);
        ISBNTextField.setText("");
        PublisherLabel.setText("");
        DeleteButton.setEnabled(false);
        ((DefaultListModel) BookAuthorsList.getModel()).removeAllElements();
        BookList.clearSelection();

    }

    public JList getBookAuthorsList() {
        return BookAuthorsList;
    }

    public JList getOrderList() {
        return OrderList;
    }

    private void checkForMessagges(String message) {
        if (message != null && message.length() > 0) {
            //create info opoup
            JOptionPane.showMessageDialog(null, message, "InfoBox: ", JOptionPane.INFORMATION_MESSAGE);
        }
    }

    /**
     * @param args the command line arguments
     */
    public BookShop getBookShop() {
        return bookShop;
    }

    public JMenuItem getExitMenuItem() {
        return ExitMenuItem;
    }

    public JMenu getFileMenu() {
        return FileMenu;
    }

    public JMenuBar getjMenuBar1() {
        return jMenuBar1;
    }

    public JList getBookList() {
        return BookList;
    }

    public JTextField getBookTitleTextField() {
        return BookTitleTextField;
    }

    public JLabel getBookTypeLabel() {
        return BookTypeLabel;
    }

    public JList getPublishersList() {
        return PublishersList;
    }

    public JTextField getISBNTextField() {
        return ISBNTextField;
    }


    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton AddNewAutorBookButton;
    private javax.swing.JButton AddNewOrderButton;
    private javax.swing.JButton AddPublisherButton;
    private javax.swing.JTabbedPane AuthorsTabbedPane;
    private javax.swing.JList BookAuthorsList;
    private javax.swing.JList BookList;
    private javax.swing.JComboBox BookPublisherComboBox;
    private javax.swing.JTextField BookTitleTextField;
    private javax.swing.JPanel BookTitleTypePanel;
    private javax.swing.JList BookToBeOrderedList;
    private javax.swing.JLabel BookTypeLabel;
    private javax.swing.JButton DeleteButton;
    private javax.swing.JButton DeleteOrder;
    private javax.swing.JButton DeletePublisherButton;
    private org.jdesktop.swingx.JXDatePicker DeliveryDatePicker;
    private javax.swing.JRadioButton EbookRadioButton1;
    private javax.swing.JMenuItem ExitMenuItem;
    private javax.swing.JMenu FileMenu;
    private javax.swing.JTextField ISBNTextField;
    private javax.swing.JList OrderContentList;
    private org.jdesktop.swingx.JXDatePicker OrderDatePicker;
    private javax.swing.JList OrderList;
    private javax.swing.JComboBox OrderPublisherComboBox1;
    private javax.swing.JRadioButton PaperRadioButton2;
    private javax.swing.JCheckBox PendingOrdersCheckBox;
    private javax.swing.JTextField PriceTextField;
    private javax.swing.JButton ProcessButton;
    private javax.swing.JList PublisherBooksList;
    private javax.swing.JTextField PublisherEmailTextField;
    private javax.swing.JLabel PublisherLabel;
    private javax.swing.JTextField PublisherPOstalCodeTextField;
    private javax.swing.JTextField PublisherPhoneNumberTextField;
    private javax.swing.JList PublishersList;
    private org.jdesktop.swingx.JXDatePicker PublishingDateDatePicker;
    private javax.swing.ButtonGroup buttonGroup1;
    private javax.swing.JButton jButton1;
    private javax.swing.JButton jButton3;
    private javax.swing.JCheckBoxMenuItem jCheckBoxMenuItem1;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel10;
    private javax.swing.JLabel jLabel11;
    private javax.swing.JLabel jLabel12;
    private javax.swing.JLabel jLabel13;
    private javax.swing.JLabel jLabel14;
    private javax.swing.JLabel jLabel15;
    private javax.swing.JLabel jLabel16;
    private javax.swing.JLabel jLabel17;
    private javax.swing.JLabel jLabel18;
    private javax.swing.JLabel jLabel19;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel20;
    private javax.swing.JLabel jLabel21;
    private javax.swing.JLabel jLabel22;
    private javax.swing.JLabel jLabel23;
    private javax.swing.JLabel jLabel24;
    private javax.swing.JLabel jLabel25;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JLabel jLabel6;
    private javax.swing.JLabel jLabel8;
    private javax.swing.JLabel jLabel9;
    private javax.swing.JList jList1;
    private javax.swing.JMenu jMenu1;
    private javax.swing.JMenu jMenu2;
    private javax.swing.JMenuBar jMenuBar1;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPanel jPanel10;
    private javax.swing.JPanel jPanel2;
    private javax.swing.JPanel jPanel3;
    private javax.swing.JPanel jPanel4;
    private javax.swing.JPanel jPanel5;
    private javax.swing.JPanel jPanel6;
    private javax.swing.JPanel jPanel7;
    private javax.swing.JPanel jPanel8;
    private javax.swing.JPanel jPanel9;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JScrollPane jScrollPane10;
    private javax.swing.JScrollPane jScrollPane2;
    private javax.swing.JScrollPane jScrollPane3;
    private javax.swing.JScrollPane jScrollPane4;
    private javax.swing.JScrollPane jScrollPane5;
    private javax.swing.JScrollPane jScrollPane6;
    private javax.swing.JScrollPane jScrollPane7;
    private javax.swing.JScrollPane jScrollPane8;
    private javax.swing.JScrollPane jScrollPane9;
    private javax.swing.JSeparator jSeparator4;
    private javax.swing.JTable jTable2;
    private javax.swing.JTable jTable3;
    private javax.swing.JTextField jTextField1;
    private javax.swing.JTextField jTextField2;
    private javax.swing.JTextField jTextField3;
    private javax.swing.JTextField jTextField4;
    private javax.swing.JTextField publisherNameTextField;
    // End of variables declaration//GEN-END:variables

    private RowSorter<? extends TableModel> createjTable2TableSorter() {
        TableRowSorter sorter = new TableRowSorter(jTable3.getModel());

        RowFilter<DefaultTableModel, Object> rf = null;
        //If current expression doesn't parse, don't update.
        try {
            rf = RowFilter.regexFilter(jTextField3.getText(), 0);
        } catch (java.util.regex.PatternSyntaxException e) {
            e.printStackTrace();
            return null;
        }
        sorter.setRowFilter(rf);
        return sorter;
    }

    public JRadioButton getEbookRadioButton1() {
        return EbookRadioButton1;
    }

    public JRadioButton getPaperRadioButton2() {
        return PaperRadioButton2;
    }

    public JXDatePicker getPublishingDateDatePicker() {
        return PublishingDateDatePicker;
    }

    public JLabel getPublisherLabel() {
        return PublisherLabel;
    }

    public JTextField getPublisherEmailTextField() {
        return PublisherEmailTextField;
    }

    public JTextField getPublisherPOstalCodeTextField() {
        return PublisherPOstalCodeTextField;
    }

    public JTextField getPublisherPhoneNumberTextField() {
        return PublisherPhoneNumberTextField;
    }

    public JTextField getPublisherNameTextField() {
        return publisherNameTextField;
    }

    public JXDatePicker getDeliveryDatePicker() {
        return DeliveryDatePicker;
    }

    public JXDatePicker getOrderDatePicker() {
        return OrderDatePicker;
    }

    public JTextField getPriceTextField() {
        return PriceTextField;
    }

    public JComboBox getBookPublisherComboBox() {
        return BookPublisherComboBox;
    }

    
    
    
}
